package com.liam.thread.one;


public class HowToCreateTread {

    static class Thread01 extends Thread{
        @Override
        public void run() {
            System.out.println("thread-1");
        }
    }

    static class Runnable02 implements Runnable{
        @Override
        public void run() {
            System.out.println("thread-2");
        }
    }

    public static void main(String[] args) {
        new Thread01().start();
        new Thread(new Runnable02()).start();

        new Thread(() ->{
            System.out.println("thread-3");
        }).start();
    }

    /**
     * sleep()              指定时间内，让给其他线程
     * yield()              让出一下，下一次可能又立刻拿回来
     * join()               t1.join(); 让t1线程加入进来
     *
     * 状态：
     *      new         start()
     *      runable     ready,runing
     *      timedwaiting
     *      waiting
     *      blocked
     *
     * synchronized     可重入锁
     */




}
